﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CNVP.JShop.UI;
using CNVP.Framework.Utils;

namespace CNVP.JShop.Web.Admin
{
    public partial class StandardValuePic : AdminPage
    {
        protected void Page_Load(object sender, System.EventArgs e)
        {
            ClearClientPageCache();
            // 在此处放置用户代码以初始化页面
            int id = 0;
            if (!string.IsNullOrEmpty(Request.QueryString["ID"]) && Public.IsNumber(Request.QueryString["ID"]))
            {
                id = Convert.ToInt32(Request.QueryString["ID"]);
            }
            string len = Request.QueryString["len"].ToString();
            string hthm = "";
            var list_StandardValue = new BLL.CNVP_StandardValue().GetAll_CNVP_StandardValue(id);
            for (int i = 0; i < list_StandardValue.Count; i++)
            {
                hthm += "<img src=\"" + list_StandardValue[i].StandardValuePic + "\" alt=\"" + list_StandardValue[i].StandardValueName + "\" style=\"width:50px;height:50px;margin:5px 5px 5px 5px;cursor:pointer;\" onclick=\"selectpic(" + list_StandardValue[i].ID + ",'" + list_StandardValue[i].StandardValuePic + "','" + len + "');\">";
               int j = i + 1;
               if (j % 8 == 0)
               {
                   hthm += "</br>";
               }
            }
            lbStandardValue.Text = hthm;
        }

        /// 
        /// 清空浏览器客户端的缓存
        /// 
        public static void ClearClientPageCache()
        {
            HttpContext.Current.Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
            HttpContext.Current.Response.Cache.SetNoStore();
        }
    }
}